package com.club325.voicemicroblog.persist.test;

import java.sql.Timestamp;

import com.club325.voicemicroblog.database.hibernateutil.HibernateUtil;
import com.club325.voicemicroblog.domain.ForbiddenIP;

public class ForbiddenIPEnvironment implements Environment {
	protected ForbiddenIP fiOld;
	protected ForbiddenIP fiNew;

	public void setup() {
		fiOld = new ForbiddenIP();
		fiNew = new ForbiddenIP();
		fiOld.setIP("TestIP1");
		fiNew.setIP("TestIP2");
		fiOld.setEndTime(new Timestamp(System.currentTimeMillis()));
		fiNew.setEndTime(new Timestamp(System.currentTimeMillis() + 1000000));
		HibernateUtil.add(fiOld);
		HibernateUtil.add(fiNew);
	}

	public void tearDown() {
		HibernateUtil.delete(fiOld);
		HibernateUtil.delete(fiNew);
	}
}